<template>
  <div>
    <h2>{{ title }}</h2>
  </div>
  <button @click="send">传值</button>
</template>

<script setup lang=ts>
  
const props = withDefaults(defineProps<{
    title:string
  }>(),{
    title:"默认值"
  })
  console.log(props.title);
  
  const emit = defineEmits<{
    (e:"on-click",name:string):void
  }>()
  const send = ()=>{
    emit("on-click","小满")
  }

  defineExpose({
    name: "大满",
    open: () => console.log(123)
    
  })
</script>

<style scoped>
</style>